-
Notifications
You must be signed in to change notification settings - Fork 2k
Add udev rule for running openocd #3535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add udev rule for running openocd #3535
Conversation
|
|
||
| NOTE: When you use the Debug Probe to upload a binary the ELF version of the file is used, not the UF2 file that you would use when you drag-and-drop. | ||
|
|
||
| On linux you might be able to run `openocd` without `sudo` depending on your distribution. If it doesn't work without `sudo` you can add a udev rule, e.g. add the following to `/etc/udev/rules.d/51-usb-perms.rules` and reload your udev rules with `sudo udevadm control --reload ; sudo udevadm trigger` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
linux->Linux
| On linux you might be able to run `openocd` without `sudo` depending on your distribution. If it doesn't work without `sudo` you can add a udev rule, e.g. add the following to `/etc/udev/rules.d/51-usb-perms.rules` and reload your udev rules with `sudo udevadm control --reload ; sudo udevadm trigger` | ||
|
|
||
| ---- | ||
| SUBSYSTEM=="usb", ATTR{idVendor}=="0a5c", ATTR{idProduct}=="000c", GROUP="plugdev", MODE="0660" | ||
| ---- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| On linux you might be able to run `openocd` without `sudo` depending on your distribution. If it doesn't work without `sudo` you can add a udev rule, e.g. add the following to `/etc/udev/rules.d/51-usb-perms.rules` and reload your udev rules with `sudo udevadm control --reload ; sudo udevadm trigger` | |
| ---- | |
| SUBSYSTEM=="usb", ATTR{idVendor}=="0a5c", ATTR{idProduct}=="000c", GROUP="plugdev", MODE="0660" | |
| ---- | |
| [TIP] | |
| ==== | |
| If this command requires `sudo`, you can remove the `sudo` requirement by adding the following udev rule to `/etc/udev/rules.d/51-usb-perms.rules`: | |
| ---- | |
| SUBSYSTEM=="usb", ATTR{idVendor}=="0a5c", ATTR{idProduct}=="000c", GROUP="plugdev", MODE="0660" | |
| ---- | |
| Reload your udev rules with `sudo udevadm control --reload ; sudo udevadm trigger`. You should now be able to run `openocd` without `sudo`. | |
| ==== |
Suggestion: move this to an admonition block, since it's not part of the standard instruction flow. Streamline the wording a bit. Some minor changes to follow the documentation style guide, e.g. introducing code blocks with a colon and a clear description.
NOTE: we should probably merge #3523 first because it's big, important, and this PR could introduce merge conflicts since there's lot of scattered renaming in the same file edited in this PR.
|
Like was done with raspberrypi/picotool#50 , perhaps it's better to just provide a pre-written |
|
I'm going to close this and reopen if I can make sense of what's going on |
|
Note: on Linux it shouldn't be necessary to run openocd as root or add another udev file. When you install openocd with apt it installs /lib/udev/rules.d.60-openocd.rules. One of the last rules is looking for a product that contains the text "CMSIS-DAP", which the debug probe uses. This gives permission if you're in the plugdev group. This should also work for a debug probe on a pico. |
...which most users already are on most Linux distros. |
I can run openocd without sudo on Raspberry Pi OS and Ubuntu when running on rpi, but my virtual box seems to need it. This seems to cause people to worry and raise support issues, so I suggest we add some details about the udev rule required.